package com.dronff.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.dronff.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * @author tyf
 * @date 2022/7/21 17:21
 */
public interface UserMapper extends BaseMapper<User> {
    @Update("UPDATE user SET coin=coin-#{num} WHERE id=#{id} AND coin >= #{num}")
    public Integer decUserCoin(@Param("id")Integer id,@Param("num")Integer num);
}
